# file tr2.mod 
# transportation model on complete bipartite graph with sets

set Warehouses;
set Customers;

 #transportation cost from warehouse i
 #to customer j
param cost{i in Warehouses, j in Customers};

param supply{i in Warehouses};    #supply at warehouse i

param demand{j in Customers};    #demand at customer j

var amount{i in Warehouses, j in Customers};

minimize Cost:
    sum{i in Warehouses, j in Customers} cost[i,j]*amount[i,j];

subject to Supply {i in Warehouses}:
    sum{j in Customers} amount[i,j] = supply[i];

subject to Demand {j in Customers}:
    sum{i in Warehouses} amount[i,j] = demand[j];

subject to positive{i in Warehouses, j in Customers}:
    amount[i,j]>=0;
